<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<link rel="shortcut icon" href="__IMG__/favicon.ico" />
		<link rel="bookmark" href="__IMG__/favicon.ico" type="image/x-icon" 　/>
		<title>提现</title>
		<link rel="stylesheet" type="text/css" href="__CSS__/mui.min.css"/>
		<link rel="stylesheet" type="text/css" href="__CSS__/common.css"/>
		<script src="__JS__/mui.min.js" type="text/javascript" charset="utf-8"></script>
		<script type="text/javascript" charset="utf-8">
	      	mui.init();
        </script>
        <style type="text/css">
        	input{
        		margin: 0;
        	}
        	.put{
        		width: 100px;
        		height: 100px;
        		background: url(__IMG__/iconfont-tianjia.png)no-repeat;
        		background-size:100% 100% ;
        		position: relative;
        		z-index: 10;
            }
            input[type=button]{
            	width: 200px;
            	text-align: center;
            	color: #fff;
            	border: none;
            }
			.next_a{
				width: 200px;
				height: 40px;
				background: url(__IMG__/bg_inp.png)no-repeat;
				background-size:100% 100% ;
				color: #fff;
				line-height: 40px;
				text-align: center;
				margin-top: 20px;
			}
        </style>
	</head>
	<body class="bg_ff">
		<header class="mui-bar mui-bar-nav">
			<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
		    <h1 class="mui-title">提现</h1>
		    <a href="{:url('mine/withdraw_record')}" class="blue padding_10 right">提现记录</a>
		</header>
		<div class="mui-content bg_ff">

		   <div class="padding_10">
			   <p>
				   <label for="">开户银行：</label>
				   <select name="bank" id="bank">
					   <option value="0">请选择开户行</option>
					   {foreach $bank as $k=>$v}
					   <option value="{$v['bank']}" {if $data['bank']==$v['bank']} selected {/if}>{$v['bank']}</option>
					   {/foreach}
				   </select>
				   <i style="position: absolute;top: 60px;right: 20px;width: 12px;height: 8px;background: url(__IMG__/down.png)no-repeat;"></i>
			   </p>
			   <p>
				   	<label for="">真实姓名：</label>
				   	<input type="text"  id="username" value="{$data['true_name']|default=''}" />
				    <input type="hidden"  id="way" value="{$data['way']}" />
			   </p>
			   <p>
				   <label for="">开户支行：</label>
				   <input type="text" name="" id="branch_bank" value="{$data['branch_bank']|default=''}" />
			   </p>
			   <p>
				   <label for="">银行账号：</label>
				   <input type="text" name="" id="account_bank" value="{$data['bank_card']|default=''}" />
			   </p>
			   <p>
				   <label for="">提现金额：</label>
				   <input type="text"  id="money" value="" />
			   </p>

			   <h6 class="clearfix"><span class="right"><i>0</i>/200</span></h6>

			   <p class="text-center mg_top40">
				   <a href="#" id="tx" class="next_a">提交</a>
			   </p>
		   </div>
		</div>
	</body>
	<script src="__JSA__/jquery-1.10.2.min.js"></script>
	<script src="__JS__/layer.js" ></script>
	<script src="__JS__/rooms.js" ></script>
	<script>
        $('#tx').click(function () {
            var username     = $('#username').val();
            var money        = $('#money').val();
            var bank         = $('#bank option:selected').val();
            var way          = $('#way').val();
            var branch_bank  = $('#branch_bank').val();
            var account_bank = $('#account_bank').val();
            if(username==""){
                 my_error('请填写真实姓名');
                return false;
            }
            if(bank==""){
                 my_error('请选择开户行');
                return false;
            }
            if(branch_bank==""){
                 my_error('请填写开户支行');
                return false;
            }
            if(account_bank==""){
                 my_error('请填写一行账号');
                return false;
            }
            if(money==""){
                 my_error('请填写提现金额');
                return false;
            }
            $.ajax({
                type: "post",
                url: "{:url('mine/do_withdrawals')}",
                data: {
                    "username": username,
                    'money': money,
                    'bank_name': bank,
                    'way':way,
                    'branch_name':branch_bank,
                    'account_bank':account_bank
                },
                dataType: "json",
                async: false,
                success: function(data) {
                    var ret = data.ret;
                    var msg = data.msg;
                    if(ret=='200'){
                         my_error(msg);
                    }else{
                         my_error(msg);
                    }
                }
            });
        })

	</script>
</html>
